﻿#region Copyright(C) 2018 FI Ltd. All rights reserved.
// ==================================================================================================
// Copyright(C) 2018 FI Ltd. All rights reserved.
//
// SYSTEM NAME	    : FI.Net Application Framework
// COMPONENT ID	    : FI.Core
// COMPONENT DESC   : FI.Net Core Foundation
//
// CREATED DATE/BY  : 18 Aug 2018 / Tian Mi
//
// REVISION HISTORY :	
// DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================
#endregion

using FI.Core.Utilities;
using System;

namespace FI.Core.Configuration
{
    /// <summary>
    /// This attribute is appied to a configurable type to specify the configuration element type.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public sealed class ConfigurationElementAttribute: Attribute
    {
        /// <summary>
        /// Gets the type of the configuration element.
        /// </summary>
        /// <value>
        /// The type of the configuration element.
        /// </value>
        public Type ConfigurationElementType { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ConfigurationElementAttribute"/> class.
        /// </summary>
        /// <param name="configurationElementType">Type of the configuration element.</param>
        public ConfigurationElementAttribute(Type configurationElementType)
        {
            Guard.ArgumentNotNull(configurationElementType, "configurationElementType");
            this.ConfigurationElementType = configurationElementType;
        }
    }
}
